package it.valeandre.omino.model;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;

@Root(name="settings")
public class Setting {

	@Element(name = "team", required = false)
	private SettingTeam team;
	
	@Element (name = "flagPush", required = false)
	private SettingPushFlag flagPush;
	
	@Element (name = "teamsList", required = false)
	private String teamsListString;
	
	public String getTeamsListString() {
		return teamsListString;
	}
	public void setTeamsListString(String teamsListString) {
		this.teamsListString = teamsListString;
	}
	public ArrayList<String> getTeamsList() {
		if(teamsListString != null && teamsListString.length() > 0) {
			teamsListString = teamsListString.trim();
			String[] teams = teamsListString.split(" ");
			List<String> list =  Arrays.asList(teams);
			return new ArrayList<String>(list);
		} else {
			return new ArrayList<String>();
		}
	}
	public SettingTeam getTeam() {
		return team;
	}
	public void setTeam(SettingTeam team) {
		this.team = team;
	}
	public SettingPushFlag getFlagPush() {
		return flagPush;
	}
	public void setFlagPush(SettingPushFlag flagPush) {
		this.flagPush = flagPush;
	}
	
	

	
	
	
}
